package net.ymate.wechat.model;

import net.ymate.platform.core.beans.annotation.PropertyState;
import net.ymate.platform.persistence.IShardingable;
import net.ymate.platform.persistence.annotation.Default;
import net.ymate.platform.persistence.annotation.Entity;
import net.ymate.platform.persistence.annotation.Id;
import net.ymate.platform.persistence.annotation.Property;
import net.ymate.platform.persistence.jdbc.IConnectionHolder;
import net.ymate.platform.persistence.jdbc.support.BaseEntity;

/**
 * WechatScan generated By EntityGenerator on 2017/08/18 上午 09:39:10
 *
 * @author YMP
 * @version 1.0
 */
@Entity("wechat_scan")
public class WechatScan extends BaseEntity<WechatScan, java.lang.String> {

    private static final long serialVersionUID = 1L;

    @Id
    @Property(name = "id", nullable = false, length = 32)
    @PropertyState(propertyName = "id")
    private java.lang.String id;

    @Property(name = "account_id", nullable = false, length = 32)
    @PropertyState(propertyName = "account_id")
    private java.lang.String accountId;

    @Property(name = "wx_uid", nullable = false, length = 256)
    @PropertyState(propertyName = "wx_uid")
    private java.lang.String wxUid;

    @Property(name = "scene", nullable = false, length = 64)
    @PropertyState(propertyName = "scene")
    private java.lang.String scene;

    @Property(name = "ticket", length = 256)
    @PropertyState(propertyName = "ticket")
    private java.lang.String ticket;

    @Property(name = "hits", length = 20)
    @Default("0")
    @PropertyState(propertyName = "hits")
    private java.lang.Long hits;

    @Property(name = "create_time", nullable = false, length = 13)
    @PropertyState(propertyName = "create_time")
    private java.lang.Long createTime;

    @Property(name = "last_modify_time", length = 13)
    @Default("0")
    @PropertyState(propertyName = "last_modify_time")
    private java.lang.Long lastModifyTime;

    /**
     * 构造器
     */
    public WechatScan() {
    }

    /**
     * 构造器
     *
     * @param id
     * @param accountId
     * @param wxUid
     * @param scene
     * @param createTime
     */
    public WechatScan(java.lang.String id, java.lang.String accountId, java.lang.String wxUid, java.lang.String scene, java.lang.Long createTime) {
        this.id = id;
        this.accountId = accountId;
        this.wxUid = wxUid;
        this.scene = scene;
        this.createTime = createTime;
    }

    /**
     * 构造器
     *
     * @param id
     * @param accountId
     * @param wxUid
     * @param scene
     * @param ticket
     * @param hits
     * @param createTime
     * @param lastModifyTime
     */
    public WechatScan(java.lang.String id, java.lang.String accountId, java.lang.String wxUid, java.lang.String scene, java.lang.String ticket, java.lang.Long hits, java.lang.Long createTime, java.lang.Long lastModifyTime) {
        this.id = id;
        this.accountId = accountId;
        this.wxUid = wxUid;
        this.scene = scene;
        this.ticket = ticket;
        this.hits = hits;
        this.createTime = createTime;
        this.lastModifyTime = lastModifyTime;
    }

    @Override
    public java.lang.String getId() {
        return id;
    }

    @Override
    public void setId(java.lang.String id) {
        this.id = id;
    }


    /**
     * @return the accountId
     */
    public java.lang.String getAccountId() {
        return accountId;
    }

    /**
     * @param accountId the accountId to set
     */
    public void setAccountId(java.lang.String accountId) {
        this.accountId = accountId;
    }

    /**
     * @return the wxUid
     */
    public java.lang.String getWxUid() {
        return wxUid;
    }

    /**
     * @param wxUid the wxUid to set
     */
    public void setWxUid(java.lang.String wxUid) {
        this.wxUid = wxUid;
    }

    /**
     * @return the scene
     */
    public java.lang.String getScene() {
        return scene;
    }

    /**
     * @param scene the scene to set
     */
    public void setScene(java.lang.String scene) {
        this.scene = scene;
    }

    /**
     * @return the ticket
     */
    public java.lang.String getTicket() {
        return ticket;
    }

    /**
     * @param ticket the ticket to set
     */
    public void setTicket(java.lang.String ticket) {
        this.ticket = ticket;
    }

    /**
     * @return the hits
     */
    public java.lang.Long getHits() {
        return hits;
    }

    /**
     * @param hits the hits to set
     */
    public void setHits(java.lang.Long hits) {
        this.hits = hits;
    }

    /**
     * @return the createTime
     */
    public java.lang.Long getCreateTime() {
        return createTime;
    }

    /**
     * @param createTime the createTime to set
     */
    public void setCreateTime(java.lang.Long createTime) {
        this.createTime = createTime;
    }

    /**
     * @return the lastModifyTime
     */
    public java.lang.Long getLastModifyTime() {
        return lastModifyTime;
    }

    /**
     * @param lastModifyTime the lastModifyTime to set
     */
    public void setLastModifyTime(java.lang.Long lastModifyTime) {
        this.lastModifyTime = lastModifyTime;
    }


    //
    // Chain
    //

    public static WechatScanBuilder builder() {
        return new WechatScanBuilder();
    }

    public WechatScanBuilder bind() {
        return new WechatScanBuilder(this);
    }

    public static class WechatScanBuilder {

        private WechatScan _model;

        public WechatScanBuilder() {
            _model = new WechatScan();
        }

        public WechatScanBuilder(WechatScan model) {
            _model = model;
        }

        public WechatScan build() {
            return _model;
        }


        public IConnectionHolder connectionHolder() {
            return _model.getConnectionHolder();
        }

        public WechatScanBuilder connectionHolder(IConnectionHolder connectionHolder) {
            _model.setConnectionHolder(connectionHolder);
            return this;
        }

        public String dataSourceName() {
            return _model.getDataSourceName();
        }

        public WechatScanBuilder dataSourceName(String dsName) {
            _model.setDataSourceName(dsName);
            return this;
        }

        public IShardingable shardingable() {
            return _model.getShardingable();
        }

        public WechatScanBuilder shardingable(IShardingable shardingable) {
            _model.setShardingable(shardingable);
            return this;
        }

        public java.lang.String id() {
            return _model.getId();
        }

        public WechatScanBuilder id(java.lang.String id) {
            _model.setId(id);
            return this;
        }

        public java.lang.String accountId() {
            return _model.getAccountId();
        }

        public WechatScanBuilder accountId(java.lang.String accountId) {
            _model.setAccountId(accountId);
            return this;
        }

        public java.lang.String wxUid() {
            return _model.getWxUid();
        }

        public WechatScanBuilder wxUid(java.lang.String wxUid) {
            _model.setWxUid(wxUid);
            return this;
        }

        public java.lang.String scene() {
            return _model.getScene();
        }

        public WechatScanBuilder scene(java.lang.String scene) {
            _model.setScene(scene);
            return this;
        }

        public java.lang.String ticket() {
            return _model.getTicket();
        }

        public WechatScanBuilder ticket(java.lang.String ticket) {
            _model.setTicket(ticket);
            return this;
        }

        public java.lang.Long hits() {
            return _model.getHits();
        }

        public WechatScanBuilder hits(java.lang.Long hits) {
            _model.setHits(hits);
            return this;
        }

        public java.lang.Long createTime() {
            return _model.getCreateTime();
        }

        public WechatScanBuilder createTime(java.lang.Long createTime) {
            _model.setCreateTime(createTime);
            return this;
        }

        public java.lang.Long lastModifyTime() {
            return _model.getLastModifyTime();
        }

        public WechatScanBuilder lastModifyTime(java.lang.Long lastModifyTime) {
            _model.setLastModifyTime(lastModifyTime);
            return this;
        }

    }

    /**
     * WechatScan 字段常量表
     */
    public class FIELDS {
        public static final String ID = "id";
        public static final String ACCOUNT_ID = "account_id";
        public static final String WX_UID = "wx_uid";
        public static final String SCENE = "scene";
        public static final String TICKET = "ticket";
        public static final String HITS = "hits";
        public static final String CREATE_TIME = "create_time";
        public static final String LAST_MODIFY_TIME = "last_modify_time";
    }

    public static final String TABLE_NAME = "wechat_scan";

}
